package cn.itcast.bos.delivery.dao;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import cn.itcast.bos.domain.delivery.Promotion;

public interface PromotionDao extends JpaRepository<Promotion, Integer>,JpaSpecificationExecutor<Promotion>{

	@Query("update Promotion set status=2  where endDate<:date  and status=2")
	@Modifying
	public void deadJob(@Param("date") Date date);
	
	public List<Promotion> findByStatus(String status);
}
